bank_cards = [
    {"id": "1001", "password": "123", "balance": 1000},
    {"id": "1002", "password": "123", "balance": 2000},
    {"id": "1003", "password": "123", "balance": 3000}
]
login_chance = 0

while login_chance < 3:
    id = input("请输入银行卡号：")
    password = input("请输入密码：")

    for card in bank_cards:
        if card["id"] == id and card["password"] == password:
            print("登录成功！")
            while True:
                print("请选择操作：")
                print("1. 取款")
                print("2. 存款")
                print("3. 退出")
                choice = input("请输入选择的操作编号：")
                if choice == "1":
                    amount = float(input("请输入取款金额："))
                    if amount <= card["balance"]:
                        card["balance"] -= amount
                        print("取款成功！余额为：", card["balance"])
                    else:
                        print("余额不足！")
                elif choice == "2":
                    amount = float(input("请输入存款金额："))
                    card["balance"] += amount
                    print("存款成功！余额为：", card["balance"])
                elif choice == "3":
                    break
                else:
                    print("无效的选择！")
            break
    else:
        print("登录失败！请重新输入卡号密码。")
        login_chance += 1
print("银行卡已被锁定")